﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;

namespace wicDIG
{
    public class PointItem
    {
        public PointF onBoard;
        public int serial;
        public int group;
        public override string ToString()
        {
            return System.String.Format("  {0}  {1}  {2};", new object[] { serial.ToString(), Float2String(onBoard.X,UtilDig.precision), Float2String(onBoard.Y,UtilDig.precision) });
        }
        public PointItem(int s, PointF o)
        {
            group = 0;
            onBoard = new PointF(o.X, o.Y);
            serial = s;
        }
        public static string Float2String(float f, int precision)
        {
            double p = Math.Pow(10,precision);
            return (Math.Round(f * p) / p).ToString();
        }
    }
}
